home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / AppleTalk Wide Area / XTI Shell Sample Code / Shell includes / TADev.h next >
Encoding:
C/C++ Source or Header  |  1993-02-11  |  4.9 KB  |  133 lines  |  [TEXT/MPS ]

  1. /*______________________________________________________________________________
  2.  
  3. TAdev.h
  4.  
  5. Include file for ADEV Calls for the Apple Internet Router.
  6.  
  7. ••• Note •••
  8. You must get an itemRef assigned to you by MacDTS and replace the kXTIShellRef
  9. with the value assigned.
  10.  
  11. Copyright Apple Computer, Inc. 1990-1993.
  12. All rights reserved.
  13. ______________________________________________________________________________*/
  14.  
  15. #ifndef __TADEV__
  16. #define __TADEV__
  17.  
  18. #include    <Types.h>
  19. #include    <QuickDraw.h>
  20.  
  21. /*_________________________ Method-Based Interface _________________ */
  22.  
  23. /* ___ Ref codes for itemRef field of adevItem record ___ */
  24.  
  25. /* ___ DEVICES: hi word = hardware, lo word = id/slot ___ */
  26. #define        kBuiltInRef            0x00010000            /* add built-in id to base num */
  27. #define        kModemPort            1                    /* modem port id */
  28. #define     kPrinterPort        2                    /* printer port id */
  29.  
  30. #define        kNuBusRef            0x00020000            /* if slots, add slot # to base num */
  31. #define        kSCSIRef            0x00030000            /* add scsi id to base num */
  32.  
  33. /* ___ PORTS: particular to each device ___ */
  34. #define        kSerialNBPortBase    1                    /* Serial NB ports 1...4 */
  35.  
  36. /* ___ METHODS (use adev res id, or existing ref) ___ */
  37. #define        kXTIShellRef        999                    /* This is an invalid ref, change it to */
  38.                                                     /* assigned itemRef */
  39.  
  40. /* ___ Device itemFlags masks ___ */
  41. #define        kInfoFlagMask        0x80000000        /* Contains active information */
  42. #define        kDefFlagMask        0x00000002        /* Use icon and string as default */
  43. #define        kExclusFlagMask        0x00000001        /* Needs exclusive use of device/port */
  44.  
  45. typedef    struct    TAdevIDRec {
  46.     short        aidSize;
  47.     long        aidData[8];
  48. }     TAdevIDRec, *TAdevIDRecPtr, **TAdevIDRecHdl;
  49.  
  50. typedef    struct    TAdevItem {
  51.     long            itemFlags;
  52.     long            itemRef;
  53.     Handle            itemIcon;
  54.     StringHandle    itemStr;
  55. }     TAdevItem, *TAdevItemPtr, **TAdevItemHdl;
  56.     
  57. typedef    struct    TAdevRec {
  58.     short        adevRecVers;    /* version number of this structure, 0 for now */
  59.     TAdevIDRec    adevID;            /* info about a particular port */
  60.     long        adevLocals[2];    /* internal ADEV field */
  61.     TAdevItem    adevDevice;        /* attributes of device */
  62.     TAdevItem    adevPort;        /* attributes of port */
  63.     TAdevItem    adevMethod;        /* attributes of method */
  64. }    TAdevRec, *TAdevRecPtr, **TAdevRecHdl;
  65.  
  66.  
  67. /*_________________________ Configuration User Interface Calls _________________ */
  68.  
  69. /* ___ Modifier values (flags) ____ */
  70. #define        kAttrDefButton            0x01                    /* <-- MAGetAttr */
  71. #define        kInitNeedsInit            0x01                    /* --> MAInit */
  72. #define        kKillCantFail            0x01                    /* --> MAKill */
  73. #define        kActivWind                0x01                    /* --> MAActivate */
  74. #define     kRouterActiv            0x02                    /* --> MAInit */
  75. #define        kShiftKey                0x01                    /* --> MAClick, Key */
  76. #define        kConfigChanged            0x01                    /* <-- MAEdit, MAKey, Click */
  77. #define        kMsgHasTEField            0x02                    /* <-- Click, Key, GetConfig */
  78. #define        kMsgHasTESelect            0x04                    /* <-- Click, Key, Message */
  79.  
  80. /* ____ Error Status Codes ___ */
  81.  
  82. #define        kMGetNoMore                1                        /* MGetAdev */
  83. #define        kMInsufDrawHt            -1                        /* GetAttrib */
  84. #define        kMInitErr                -1                        /* Init */
  85. #define        kMInitErrRep            -2                        /* Init error but adev reported it */
  86. #define        kMCantClose                -1                        /* Kill */
  87. #define        kMFatalErr                -1                        /* Activate, Click, Draw, Edit, Idle, Key, MGet */
  88. #define        kMCantDeactTE            -1                        /* SelectTE */
  89. #define     kMInvalConfig             -1                        /* Get Config  -- don't close */
  90. #define        kMDiscChanges            -2                        /* Get Config -- discard changes */
  91. #define        kMPrintNoMore            -1                        /* Print -- no more to print after this one */
  92.  
  93. /* ____ Message event codes ___ */
  94. #define        kUndoEvt                0
  95. #define        kCutEvt                    1
  96. #define        kCopyEvt                2
  97. #define        kPasteEvt                3
  98. #define        kClearEvt                4
  99. #define        kRouterInact            5
  100. #define        kRouterAct                6
  101. #define        kAdjCursor                8
  102.  
  103. /* ___ Print Message ___ */
  104. #define        kPrintLine                'line'
  105.  
  106. /* ___ Balloon Help constants ___ */
  107. #define        kTipHOffset                10
  108. #define        kTipVOffset                10
  109.  
  110. #define        kMaxSumStrLen            255
  111.  
  112. typedef struct TAdevWind {
  113.     WindowPtr    awWiPtr;        /* window where drawing occurs */
  114.     Rect        awRect;            /* window rect where ADEV may draw into */
  115.     long        awMessage;        /* event message (varies according to call) */
  116.     short        awModifiers;    /* flags that affect awMessage */
  117.     Handle        awConfig;        /* config data filled in by ADEV */
  118.     Handle         awVars;            /* used by ADEV for temporary variables */
  119.     Str255        awSumStr;        /* summary string of current config data */
  120.     Str255        awSum2Str;        /* 2nd summary string used for printing config data */
  121. }    TAdevWind, *TAdevWindPtr, **TAdevWindHdl;
  122.  
  123.  
  124. /* Glue for Icon routines.  Eventually, these will be in a CInclude file */
  125. pascal OSErr NewIconSuite(Handle *theIconSuite) = {0x303C, 0x0207, 0xABC9};
  126. pascal OSErr AddIconToSuite(Handle theIconData,Handle theSuite,ResType theType)= {0x303C, 0x0608, 0xABC9};
  127. pascal OSErr GetIconFromSuite(Handle *theIconData,Handle theSuite,ResType theType)= {0x303C, 0x0609, 0xABC9};
  128. pascal OSErr GetIconSuite(Handle *theIconSuite,short theResID,long selector)= {0x303C, 0x0501, 0xABC9};    
  129. pascal OSErr DisposeIconSuite(Handle theIconSuite,Boolean disposeData)= {0x303C, 0x0302, 0xABC9};
  130.  
  131. #define        svAllSmallData        0x0000ff00
  132.  
  133. #endif